package sevensoft.行为型模式.状态模式;

import lombok.Getter;
import lombok.Setter;

@Getter
public class Context {

    public static final GunState LOAD=new LoadState();

    public static final GunState SHOOT=new ShootState();

    public static final GunState NONE=new NoneState();


    private GunState gunState;

    public void setGunState(GunState gunState) {
        this.gunState = gunState;
        this.gunState.setContext(this);
    }

    public void shoot(){
        this.gunState.shoot();
    }

    public void load(){
        this.gunState.load();
    }

    public void none(){
        this.gunState.none();
    }
}
